package com.my.strings.util;

import java.util.List;
import java.util.UUID;

/**
 * @author: marshal
 * @date: 2022-04-18 11:54 AM
 */
public class UuidTest {
    public static void main(String[] args) {
        List<String> list = List.of("YK8+735/153.66.211.142/admin/abc12345", "ZK8+750/153.66.211.132/admin/abc12345");
        String s = list.toString();
        System.out.println(convert(0, list));
        System.out.println("===========");
        System.out.println(convert(1, list));
    }

    private static String convert(int direction, List<String> list) {
        String r = "";
        String s = list.toString();
        System.out.println(s.replaceAll("ZK.*", ""));
        System.out.println(s.replaceAll("YK.*", ""));
        String s1 = s.replaceAll("\\[", "").replaceAll("]", "").replaceAll(" ", "");
        if (!s1.equals("")) {
            String s2 = s1;
            String s3 = s1;
            if (direction == 0) {
                r = s2.replaceAll("ZK.*", "");
                System.out.println("s2: " + r);
            } else {
                r = s3.replaceAll("YK.*", "");
                System.out.println("s3: " + r);
            }
            r = r.replaceAll(",", "\n");
        }
        System.out.println("s: " + s);
        System.out.println("r: " + r);
        System.out.println("s1: " + s1);
        return r;
    }
}
